#include "math/euclidean.h"

#include <cmath>

double euclideanDistance(const std::vector<double>& point1, const std::vector<double>& point2)
{
    if (point1.size() != point2.size() || point1.empty())
        throw "point1.size != point2.size";

    double sum = 0;
    for (int i = 0; i < point1.size(); i++)
    {
        const double diff = point1[i] - point2[i];
        sum += (diff * diff);
    }

    return std::sqrt(sum);
}